import type { RouteRecordRaw } from 'vue-router'

const docRoutes: RouteRecordRaw = {
  path: '/doc',
  component: () => import('./views/index.vue'),
  children: [
    {
      path: '',
      name: 'DocumentHome',
      component: () => import('./views/Main.vue'),
      meta: {
        title: '文档管理',
        requiresAuth: false
      }
    },
    {
      path: ':id',
      name: 'Detail',
      props: true,
      component: () => import('./views/Main.vue'),
      meta: {
        title: '文档详情',
        requiresAuth: false
      }
    },
    {
      path: 'favorites',
      name: 'Favorites',
      component: () => import('./views/Favorites.vue'),
      meta: {
        title: '我的收藏',
        requiresAuth: true
      }
    },
    {
      path: 'edit/:id',
      name: 'Edit',
      component: () => import('./views/Edit.vue'),
      meta: {
        title: '编辑文档',
        requiresAuth: true
      }
    },
    {
      path: 'create',
      name: 'Create',
      component: () => import('./views/Edit.vue'),
      meta: {
        title: '新建文档',
        requiresAuth: true
      }
    }
  ]
}

export default docRoutes